<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:p="http://primefaces.org/ui">

    <h:form id="PatientvisitListForm">

        <p:panel header="#{myBundle.ListPatientvisitTitle}">

            <p:dataTable id="datalist" value="#{patientvisitController.items}" var="item"
                         selectionMode="single" selection="#{patientvisitController.selected}"
                         rowKey="#{item.patientvisitPK}"
                         paginator="true"
                         rows="10"
                         rowsPerPageTemplate="10,20,30"
                         >

                <p:ajax event="rowSelect"   update="createButton viewButton editButton deleteButton"/>
                <p:ajax event="rowUnselect" update="createButton viewButton editButton deleteButton"/>

                <p:column sortBy="#{item.patientvisitPK.pid}" filterBy="#{item.patientvisitPK.pid}">
                    <f:facet name="header">
                        <h:outputText value="#{myBundle.ListPatientvisitTitle_patientvisitPK_pid}"/>
                    </f:facet>
                    <h:outputText value="#{item.patientvisitPK.pid}"/>
                </p:column>
                <p:column sortBy="#{item.patientvisitPK.vid}" filterBy="#{item.patientvisitPK.vid}">
                    <f:facet name="header">
                        <h:outputText value="#{myBundle.ListPatientvisitTitle_patientvisitPK_vid}"/>
                    </f:facet>
                    <h:outputText value="#{item.patientvisitPK.vid}"/>
                </p:column>
                <p:column sortBy="#{item.visitDateTime}" filterBy="#{item.visitDateTime}">
                    <f:facet name="header">
                        <h:outputText value="#{myBundle.ListPatientvisitTitle_visitDateTime}"/>
                    </f:facet>
                    <h:outputText value="#{item.visitDateTime}">
                        <f:convertDateTime pattern="MM/dd/yyyy HH:mm:ss" />
                    </h:outputText>
                </p:column>
                <p:column sortBy="#{item.bloodPressureUpper}" filterBy="#{item.bloodPressureUpper}">
                    <f:facet name="header">
                        <h:outputText value="#{myBundle.ListPatientvisitTitle_bloodPressureUpper}"/>
                    </f:facet>
                    <h:outputText value="#{item.bloodPressureUpper}"/>
                </p:column>
                <p:column sortBy="#{item.bloodPressureLower}" filterBy="#{item.bloodPressureLower}">
                    <f:facet name="header">
                        <h:outputText value="#{myBundle.ListPatientvisitTitle_bloodPressureLower}"/>
                    </f:facet>
                    <h:outputText value="#{item.bloodPressureLower}"/>
                </p:column>
                <p:column sortBy="#{item.temperature}" filterBy="#{item.temperature}">
                    <f:facet name="header">
                        <h:outputText value="#{myBundle.ListPatientvisitTitle_temperature}"/>
                    </f:facet>
                    <h:outputText value="#{item.temperature}"/>
                </p:column>
                <p:column sortBy="#{item.respiratoryRate}" filterBy="#{item.respiratoryRate}">
                    <f:facet name="header">
                        <h:outputText value="#{myBundle.ListPatientvisitTitle_respiratoryRate}"/>
                    </f:facet>
                    <h:outputText value="#{item.respiratoryRate}"/>
                </p:column>
                <p:column sortBy="#{item.pulse}" filterBy="#{item.pulse}">
                    <f:facet name="header">
                        <h:outputText value="#{myBundle.ListPatientvisitTitle_pulse}"/>
                    </f:facet>
                    <h:outputText value="#{item.pulse}"/>
                </p:column>
                <p:column sortBy="#{item.hid.name}" filterBy="#{item.hid.name}">
                    <f:facet name="header">
                        <h:outputText value="#{myBundle.ListPatientvisitTitle_hid}"/>
                    </f:facet>
                    <h:outputText value="#{item.hid.name}"/>
                </p:column>
                <f:facet name="footer">
                    <p:commandButton id="createButton" icon="ui-icon-plus"   value="#{myBundle.Create}" actionListener="#{patientvisitController.prepareCreate}" update=":PatientvisitCreateForm" oncomplete="PatientvisitCreateDialog.show()"/>
                    <p:commandButton id="viewButton"   icon="ui-icon-search" value="#{myBundle.View}" update=":PatientvisitViewForm" oncomplete="PatientvisitViewDialog.show()" disabled="#{empty patientvisitController.selected}"/>
                    <p:commandButton id="editButton"   icon="ui-icon-pencil" value="#{myBundle.Edit}" update=":PatientvisitEditForm" oncomplete="PatientvisitEditDialog.show()" disabled="#{empty patientvisitController.selected}"/>
                    <p:commandButton id="deleteButton" icon="ui-icon-trash"  value="#{myBundle.Delete}" actionListener="#{patientvisitController.delete}" update=":growl,datalist" disabled="#{empty patientvisitController.selected}"/>
                </f:facet>

            </p:dataTable>

        </p:panel>

    </h:form>

</ui:composition>